#include <Game/Include/PlayerInputGameEvent.h>


PlayerInputGameEvent::PlayerInputGameEvent(const int &player_id, const PlayerInputType &input_type)
    :GameEvent(GameEventType::PLAYER_INPUT_EVENT)
{
    this->player_id = player_id;
    this->input_type = input_type;
}

PlayerInputGameEvent::PlayerInputGameEvent(std::istream &s)
    :GameEvent(s)
{
    ISerializable::read(s, this->player_id);
    ISerializable::read(s, this->input_type);
}

PlayerInputGameEvent::~PlayerInputGameEvent(void)
{
}

unsigned int PlayerInputGameEvent::serialize(std::ostream &s)
{
    unsigned int bytes = GameEvent::serialize(s);
    bytes += ISerializable::write(s, this->player_id);
    bytes += ISerializable::write(s, this->input_type);
    return bytes;
}

int PlayerInputGameEvent::getPlayerId() const
{
    return this->player_id;
}

PlayerInputGameEvent::PlayerInputType PlayerInputGameEvent::getPlayerInput() const
{
    return this->input_type;
}
